A method using an entropy encoding technique based upon variable-length encoding is well known as a technique for compressing and encoding still images and moving images. Such a technique is adopted in JPEG (Joint Photographic Experts Group) encoding and MPEG (Moving Picture Experts Group) encoding, which are international standards. The entropy encoding employed in these schemes generates symbol data by applying run-length encoding to values of data obtained by subjecting orthogonal transform coefficients to quantization processing, and then generates variable-length encoded data with regard to each item of symbol data. Many hardware implementations using Huffman coding tables as the variable-length codes employed in this entropy encoding technique have been proposed in recent years.
In MPEG encoding, variable-length code is adopted for, e.g., motion vectors as syntax for constructing header information, and proposals for implementing this by hardware have also been proposed just as in cases where Huffman code tables are used.
There has been an explosive increase in the size of image data handled by various image systems owing to improvements in the data transfer capacity of recent communication networks and the higher density of storage devices. In view of these circumstances, processors for compressive encoding also required to have both high image quality and the ability to perform compressive encoding at a high bit rate.
In compressive encoding at a high bit rate, however, the number of items of symbol data is much higher in comparison with compressive encoding at a low bit rate and it is difficult to perform compressive encoding at high speed in a variable-length encoder that relies upon the prior art. Even if a variable-length encoder is applied using the prior art, processing time lengthens as the bit rate rises and, hence, such an encoder is of little practical use.
If it is attempted to realize a variable-length encoder that supports a high bit rate through use of the prior art, the frequency of the operating clock must be increased, resulting in a major increase in power consumption.
In MPEG-4 encoding the standardization of which has recently been completed, a maximum of four items of motion-vector information are required for every macro block, and variable-length encoding is necessary in each of the horizontal and vertical directions. In consideration of this fact, it is necessary to perform variable-length encoding eight times for every macro block. A problem which arises is lengthening of processing time.
The present invention has been devised in view of these circumstances and its object is to perform variable-length encoding at higher speed.